package net.cyndeline.GameMap

import net.cyndeline.entitySystem.EntityRef
import net.cyndeline.MovementDirection

/**
 * A single tile on the map.
 */
trait Tile {
  
  /** Returns all entities on the tile. */
  def content: List[EntityRef]
  
  /** Adds an entity to the tile. */
  def addEntity(entity: EntityRef): Boolean
  
  /** Removes an entity from the tile. */
  def removeEntity(entity: EntityRef): Boolean
  
  /** x position of the tile. */
  def x: Int
  
  /** y position of the tile. */
  def y: Int
  
  /** Assign a new x position. */
  def x_=(pos: Int)
  
  /** Assign a new y position. */
  def y_=(pos: Int)
  
  /** Return all neighboring tiles. */
  def getNeighbors: List[Tile]
  
  /** Return a list of all neighboring positions that have tiles on them. */
  def getNeighborPositions: List[(Int, Int)]
  
  /** Return a neighboring node in a specific direction. */
  def getNeighbor(node: MovementDirection): Option[Tile]
  
  /** Register a neighbor. */
  def addNeighbor(node: Tile): Boolean
  
  /** Unregister a neighbor. */
  def removeNeighbor(node: Tile): Boolean
  
  /** Check if this node is adjacent to another. */
  def canConnectTo(node: Tile): Boolean
  
  /** Returns a deep copy of the tile. */
  def copy: Tile
}